//
//  MVVMModel.m
//  Depressed.domo
//
//  Created by rimi on 16/5/26.
//  Copyright © 2016年 薛涛. All rights reserved.
//

#import "MVVMModel.h"

@implementation MVVMModel
- (instancetype)init
{
    self = [super init];
    if (self) {
    }
    return self;
}
- (void)loadDataImages {
    NSArray *array = @[@"http://pic2.sc.chinaz.com/files/pic/pic9/201605/apic20823.jpg",@"http://img.ivsky.com/img/tupian/pre/201308/30/yueyuanzhiye-018.jpg"];
    NSMutableArray *dataArray = [NSMutableArray array];
    dispatch_async(dispatch_get_global_queue(0, 0), ^{
        for (NSString *urlStr in array) {
            NSURL *url = [NSURL URLWithString:urlStr];
            NSData *data = [NSData dataWithContentsOfURL:url];
            UIImage *image = [UIImage imageWithData:data];
            [dataArray addObject:image];
        }
        dispatch_async(dispatch_get_main_queue(), ^{
            self.images = dataArray;
        });
    });
}
@end
